package day01;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by MGL on 2017/4/2.
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String m = sc.next();
        String n = sc.next();
        //0代表正面朝上
        BigInteger count = getCount(m, n);
        System.out.println(count);
    }

    private static BigInteger getCount(String m, String n) {
        BigInteger sqrtM = getSqrt(m);
        BigInteger sqrtN = getSqrt(n);
        return sqrtM.multiply(sqrtN);
    }

    private static BigInteger getSqrt(String s) {
        int mlen = s.length();    //被开方数的长度
        int len;    //开方后的长度
        BigInteger beSqrtNum = new BigInteger(s);//被开方数
        BigInteger sqrtOfNum;    //存储开方后的数
        BigInteger sqrtOfNumMul;    //开方数的平方
        String sString;//存储sArray转化后的字符串
        if (mlen % 2 == 0) len = mlen / 2;
        else len = mlen / 2 + 1;
        char[] sArray = new char[len];
        Arrays.fill(sArray, '0');//开方数初始化为0
        for (int pos = 0; pos < len; pos++) {
            //从最高开始遍历数组，每一位都转化为开方数平方后刚好不大于被开方数的程度
            for (char num = '1'; num <= '9'; num++) {
                sArray[pos] = num;
                sString = String.valueOf(sArray);
                sqrtOfNum = new BigInteger(sString);
                sqrtOfNumMul = sqrtOfNum.multiply(sqrtOfNum);
                if (sqrtOfNumMul.compareTo(beSqrtNum) == 1) {
                    sArray[pos] -= 1;
                    break;
                }
            }
        }
        return new BigInteger(String.valueOf(sArray));
    }


}
